package us.wili.dev.common.util.xinge.v2.service.impl;

import com.alibaba.fastjson.TypeReference;
import us.wili.dev.common.util.httpclient.HttpClientUtil;
import us.wili.dev.common.util.xinge.v2.XinGeProperties;
import us.wili.dev.common.util.xinge.v2.consts.ApiEnum;
import us.wili.dev.common.util.xinge.v2.model.BaseRsp;
import us.wili.dev.common.util.xinge.v2.model.req.push.AccountListReq;
import us.wili.dev.common.util.xinge.v2.model.req.push.SingleAccountReq;
import us.wili.dev.common.util.xinge.v2.service.AbstractXinGeService;
import us.wili.dev.common.util.xinge.v2.service.iface.PushService;

import java.util.List;

/**
 * author: lefore
 * date: 2018/8/29
 */
public class PushServiceImpl extends AbstractXinGeService implements PushService {

    public PushServiceImpl(XinGeProperties xinGeProp, HttpClientUtil httpClientUtil) {
        super(xinGeProp, httpClientUtil);
    }

    @Override
    public List<Integer> accountList(AccountListReq req) {
        return executeGet(req, ApiEnum.PUSH_ACCOUNT_LIST.getPath(), new TypeReference<BaseRsp<List<Integer>>>() {
        });
    }

    @Override
    public void singleAccont(SingleAccountReq req) {
        executeGet(req, ApiEnum.PUSH_SINGLE_ACCOUNT.getPath(), new TypeReference<BaseRsp<Object>>() {
        });
    }
}